﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using SmartProject.Entity;

using FluentNHibernate.Mapping;

namespace SmartProject.Mapping
{
    public class ProfileMap : ClassMap<Profile>
    {
        public ProfileMap()
        {
            Table("SmartProject_Profile");
            Id(x => x.Id).Column("ProfileId");
            Map(x => x.Name).Length(50).Not.Nullable();
            Map(x => x.Value).Length(150);
            References<User>(x => x.Owner)
                .Column("OwnerId")
                .Not.Nullable()
                .LazyLoad();
            Map(x => x.Active).Not.Nullable();
            Map(x => x.Created).Not.Nullable();
        }
    }
}
